
class TopGoodsModel {
  Top_goods_list_get_responseBean topGoodsListGetResponse;

  static TopGoodsModel fromMap(Map<String, dynamic> map) {
    if (map == null) return null;
    TopGoodsModel topGoodsModelBean = TopGoodsModel();
    topGoodsModelBean.topGoodsListGetResponse = Top_goods_list_get_responseBean.fromMap(map['top_goods_list_get_response']);
    return topGoodsModelBean;
  }

  Map toJson() => {
    "top_goods_list_get_response": topGoodsListGetResponse,
  };
}


class Top_goods_list_get_responseBean {
  int total;
  String listId;
  List<ListBean> list;
  String requestId;
  String searchId;

  static Top_goods_list_get_responseBean fromMap(Map<String, dynamic> map) {
    if (map == null) return null;
    Top_goods_list_get_responseBean top_goods_list_get_responseBean = Top_goods_list_get_responseBean();
    top_goods_list_get_responseBean.total = map['total'];
    top_goods_list_get_responseBean.listId = map['list_id'];
    top_goods_list_get_responseBean.list = List()..addAll(
      (map['list'] as List ?? []).map((o) => ListBean.fromMap(o))
    );
    top_goods_list_get_responseBean.requestId = map['request_id'];
    top_goods_list_get_responseBean.searchId = map['search_id'];
    return top_goods_list_get_responseBean;
  }

  Map toJson() => {
    "total": total,
    "list_id": listId,
    "list": list,
    "request_id": requestId,
    "search_id": searchId,
  };
}

/// coupon_remain_quantity : 42000
/// promotion_rate : 100
/// cat_ids : [8669,8675,8696]
/// coupon_min_order_amount : 900
/// mall_name : "��ζ�Ҿ���Ʒ��"
/// coupon_total_quantity : 50000
/// merchant_type : 1
/// lgst_txt : "��"
/// goods_name : "���ֻ��ٷ���һ���Կ�����������͸���޷Ĳ����粼50ֻװ�Ӻ�"
/// sales_tip : "1381"
/// goods_id : 94933671352
/// desc_txt : "��"
/// goods_desc : "��˳����ʡ�һ���Կ�����������͸���޷Ĳ����粼50ֻװ�Ӻ�"
/// opt_name : "����"
/// goods_thumbnail_url : "https://t00img.yangkeduo.com/goods/images/2020-03-24/dcb5241692837e5eea140ebdfb79bcb3.jpeg"
/// opt_id : 12
/// opt_ids : [1056,1282,12003,12229,10696,12,10703,20527,10737,20530,5300,20534,8569,8570,8571,1052,8605,8606,5310,8607,12223]
/// search_id : "4f8a8230091e74ca196bcbd58aacc492384"
/// goods_image_url : "https://t00img.yangkeduo.com/goods/images/2020-03-24/5521e8b6-099c-4119-a004-3d81de1c16b8.jpg"
/// min_normal_price : 2080
/// has_coupon : true
/// serv_txt : "��"
/// min_group_price : 1980
/// coupon_start_time : 1584979200
/// mall_cps : 1
/// coupon_discount : 900
/// coupon_end_time : 1585324799

class ListBean {
  int couponRemainQuantity;
  int promotionRate;
  List<int> catIds;
  int couponMinOrderAmount;
  String mallName;
  int couponTotalQuantity;
  int merchantType;
  String lgstTxt;
  String goodsName;
  String salesTip;
  int goodsId;
  String descTxt;
  String goodsDesc;
  String optName;
  String goodsThumbnailUrl;
  int optId;
  List<int> optIds;
  String searchId;
  String goodsImageUrl;
  int minNormalPrice;
  bool hasCoupon;
  String servTxt;
  int minGroupPrice;
  int couponStartTime;
  int mallCps;
  int couponDiscount;
  int couponEndTime;

  static ListBean fromMap(Map<String, dynamic> map) {
    if (map == null) return null;
    ListBean listBean = ListBean();
    listBean.couponRemainQuantity = map['coupon_remain_quantity'];
    listBean.promotionRate = map['promotion_rate'];
    listBean.catIds = List()..addAll(
      (map['cat_ids'] as List ?? []).map((o) => int.tryParse(o.toString()))
    );
    listBean.couponMinOrderAmount = map['coupon_min_order_amount'];
    listBean.mallName = map['mall_name'];
    listBean.couponTotalQuantity = map['coupon_total_quantity'];
    listBean.merchantType = map['merchant_type'];
    listBean.lgstTxt = map['lgst_txt'];
    listBean.goodsName = map['goods_name'];
    listBean.salesTip = map['sales_tip'];
    listBean.goodsId = map['goods_id'];
    listBean.descTxt = map['desc_txt'];
    listBean.goodsDesc = map['goods_desc'];
    listBean.optName = map['opt_name'];
    listBean.goodsThumbnailUrl = map['goods_thumbnail_url'];
    listBean.optId = map['opt_id'];
    listBean.optIds = List()..addAll(
      (map['opt_ids'] as List ?? []).map((o) => int.tryParse(o.toString()))
    );
    listBean.searchId = map['search_id'];
    listBean.goodsImageUrl = map['goods_image_url'];
    listBean.minNormalPrice = map['min_normal_price'];
    listBean.hasCoupon = map['has_coupon'];
    listBean.servTxt = map['serv_txt'];
    listBean.minGroupPrice = map['min_group_price'];
    listBean.couponStartTime = map['coupon_start_time'];
    listBean.mallCps = map['mall_cps'];
    listBean.couponDiscount = map['coupon_discount'];
    listBean.couponEndTime = map['coupon_end_time'];
    return listBean;
  }

  Map toJson() => {
    "coupon_remain_quantity": couponRemainQuantity,
    "promotion_rate": promotionRate,
    "cat_ids": catIds,
    "coupon_min_order_amount": couponMinOrderAmount,
    "mall_name": mallName,
    "coupon_total_quantity": couponTotalQuantity,
    "merchant_type": merchantType,
    "lgst_txt": lgstTxt,
    "goods_name": goodsName,
    "sales_tip": salesTip,
    "goods_id": goodsId,
    "desc_txt": descTxt,
    "goods_desc": goodsDesc,
    "opt_name": optName,
    "goods_thumbnail_url": goodsThumbnailUrl,
    "opt_id": optId,
    "opt_ids": optIds,
    "search_id": searchId,
    "goods_image_url": goodsImageUrl,
    "min_normal_price": minNormalPrice,
    "has_coupon": hasCoupon,
    "serv_txt": servTxt,
    "min_group_price": minGroupPrice,
    "coupon_start_time": couponStartTime,
    "mall_cps": mallCps,
    "coupon_discount": couponDiscount,
    "coupon_end_time": couponEndTime,
  };
}